Make Xm Test default to bridge when cannot read config file
authorTom Wilkie <tom.wilkie@gmail.com>
Thu, 12 Apr 2007 10:32:25 +0000 (11:32 +0100)
committerTom Wilkie <tom.wilkie@gmail.com>
Thu, 12 Apr 2007 10:32:25 +0000 (11:32 +0100)
signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>

tools/xm-test/lib/XmTestLib/NetConfig.py

index f6397fece3ee8cbe6069020cd163b2a6c5318537..652db573f6e5dd844c4eb2f5dc345d1abfeb58d9 100644 (file)
@@ -44,7 +44,11 @@ def getXendNetConfig():
     if not xconfig:
         xconfig = "/etc/xen/xend-config.sxp"
 
-    configfile = open(xconfig, 'r')
+    try:
+        configfile = open(xconfig, 'r')
+    except:
+        return "bridge"
+    
     S = configfile.read()
     pin = Parser()
     pin.input(S)